package com.geostar.constructionland.index.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.geostar.constructionland.index.entity.model.IndexWithholdModel;
import com.geostar.constructionland.index.service.IndexWithholdService;
import freemarker.template.utility.StringUtil;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.*;
@RestController
@RequestMapping("/indexWithhold")
@Api(tags = "指标预扣相关接口")
public class IndexWithholdController {


    @Resource
    IndexWithholdService indexWithholdService;

    @ApiOperation(value = "指标预扣")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "businessId",value = "业务ID",required = true),
            @ApiImplicitParam(name = "indexWithholdType",value = "出库状态",required = true),
            @ApiImplicitParam(name = "userId",value = "用户ID",required = true),
            @ApiImplicitParam(name = "userName",value = "用户名",required = true),
            @ApiImplicitParam(name = "codeTrack",value = "代码调用轨迹",required = true),
    })
    @PostMapping(value = "/indexWithhold")
    @ResponseBody
    public String indexWithhold(@Valid IndexWithholdModel indexWithholdModel){
        String result = indexWithholdService.indexWithhold(indexWithholdModel);
        if("true".equals(result)) {
            return "{Message:\"success\"}";
        }
        return result;
    }
}

